/* Popovers/Menus */

//.the popover itself
.popup-menu-boxpointer {
  -arrow-border-radius: $menu_radius * 1.5;
  -arrow-background-color: transparent;
  -arrow-border-width: 0;
  -arrow-border-color: transparent;
  -arrow-base: 30px - $menu_radius * 1.5;
  -arrow-rise: 0;
  -arrow-box-shadow: none; //dreaming. bug #689995
  background: none; // needs to reset?
}

// container of the popover menu
.popup-menu {
  min-width: if($compact == 'true', 10em, 12em);
  color: $text-secondary !important;
  padding: 0;
  font-weight: normal;
  @include fontsize($font_size - 1);

  .popup-menu-content {
    padding: $base_padding 0;
    background-color: $popover !important;
    border-radius: $menu_radius * 1.5;
    border: none;
    box-shadow: 0 3px 8px 0 rgba(black, 0.15);
    margin: $base_padding 8px 12px;
    font-weight: normal;
  }

  .popup-menu-item {
    spacing: $base_spacing * 1.5;
    color: $text-secondary !important;
    text-shadow: none;
    border-radius: 0 !important;
    margin: 0;
    font-weight: normal;

    &:checked {
      font-weight: normal;
      border: none;
      box-shadow: none;
      color: on($primary) !important;
      background-color: $primary !important;

      &:focus, &:hover, &.selected {
        color: on($primary) !important;
        background-color: lighten($primary, 5%) !important;
      }

      &:active {
        color: on($primary);
        background-color: darken($primary, 5%) !important;
      }

      &:insensitive { color: on($primary, disabled) !important; }
    }

    &:focus, &:hover, &.selected {
      color: $text !important;
      background-color: $divider !important;
      transition-duration: 0;
    }

    &:active, &.selected:active {
      color: on($primary) !important;
      background-color: $primary !important;
    }

    &:insensitive { color: $text-secondary-disabled !important; }
  }

  .popup-sub-menu {
    background-color: $fill !important;
    border: none;
    box-shadow: none;
    margin: 0;
    border-radius: 0 !important;

    .popup-menu-item {
      background-color: transparent;
    }
  }

  .popup-inactive-menu-item { //all icons and other graphical elements
    color: $text-secondary !important;

    &:insensitive { color: $text-secondary-disabled !important; }
  }

  //.popup-status-menu-item { font-weight: normal;  color: pink; } //dunno what that is
  &.panel-menu {
    -boxpointer-gap: $base_margin; // distance from the panel
    margin-bottom: 1.75em;
  }
}
// symbolic icons in popover
.popup-menu-arrow,
.popup-menu-icon { icon-size: $base_icon_size; }

// container for radio and check boxes
.popup-menu-ornament {
  width: 1.2em;

  &:ltr { text-align: right };
  &:rtl { text-align: left };
}

// desktop background menu
.background-menu {
  -boxpointer-gap: $base_margin;
  -arrow-rise: 0px; // hide the beak on the menu
}

// system status popover menu
.aggregate-menu {
  min-width: if($compact == 'true', 20em, 21em);

  // lock screen, shutdown, etc. buttons
  .popup-menu-icon {
    padding: 0;
    margin: 0 $base_padding / 2;
    -st-icon-style: symbolic;
  }
}
